import java.util.Scanner;

public class Test2 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        // 注意 hasNext 和 hasNextLine 的区别
        while (in.hasNextInt()) { // 注意 while 处理多个 case
            int n = in.nextInt();
            in.nextLine();
            boolean[][] dp = new boolean[n][n];
            StringBuilder path = new StringBuilder();
            for (int i = 0; i < n; i++) {
                int len = Integer.parseInt(in.nextLine());
                for (int j = 0; j < len; j++) {
                    char c = in.nextLine().charAt(0);
                    if (i == j) {
                        path.append(c);
                        for (int index = i; index >= 0; index--) {
                            if ((index+1 >= i) || (c == path.charAt(index) && dp[index + 1][i - 1])) {
                                dp[index][i] = index + 1 > i - 1 ? c == path.charAt(index) : dp[index+1][i - 1];
                            } else {
                                dp[index][i] = false;
                            }
                        }
                    }
                }
            }
            for (int i = 0; i < n; i++) {
                System.out.println(dp[0][i] ? "Yes" : "No");
            }
        }
    }
}
